LAUSD Schools Map

Posted on Sun 04 September 2016 in Projects

In [1]:
import warnings
warnings.filterwarnings('ignore')

import pandas
import folium
import json
In [2]:
mapOBJ = folium.Map(location=[34.1826, -118.4397],tiles='cartodbpositron',zoom_start=11)
with open("lausd.geojson")as file:
    data = json.load(file)
data2 = pandas.read_json(json.dumps(data["features"]), typ='frame')
data2 = data2.ix[:,1]

data2 = pandas.concat([pandas.DataFrame.from_dict(item, orient='index').T for item in data2])
mapOBJ.geo_json(geo_path='lausd.geojson',
                data=data2,columns=('OBJECTID_2','SHAPE_AREA'),
                key_on='feature.properties.OBJECTID_2',
                fill_color='RdPu',
                fill_opacity=0.7, 
                line_opacity=0.2,
                legend_name = 'Square Feet',
                reset=True
                )
mapOBJ.create_map(path='map_school_area.html')
In [3]:
mapOBJ
Out[3]: